package com.clazz;

import java.io.File;
import java.io.FileOutputStream;

import org.springframework.asm.ClassReader;
import org.springframework.asm.ClassWriter;

public class Generator {
	public static void main(String[] args) throws Exception {
		// 读取
		ClassReader classReader = new ClassReader("com/clazz/Base");
		ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
		// 处理
        classReader.accept(new MyClassVisitor(classWriter), ClassReader.SKIP_DEBUG);
        byte[] data = classWriter.toByteArray();
        // 输出
        File f = new File("E:/JAVA/project/test/src/main/java/com/clazz/Base.class");
        FileOutputStream fout = new FileOutputStream(f);
        fout.write(data);
        fout.close();
        System.out.println("now generator cc success!!!!!");
		
	}
}
